package share;

import android.app.Activity;
import android.app.Dialog;
import android.graphics.drawable.ColorDrawable;
import android.view.View;
import android.view.Window;

import com.laoxinwen.app.R;


public class ShareDialog {

    public static Dialog getShareDialog(final Activity activity, final View.OnClickListener listener) {
        final Dialog dialog = new Dialog(activity);
        dialog.setCancelable(true);
        dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(R.layout.dialog_share);
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
        dialog.getWindow().findViewById(R.id.share_qq).setOnClickListener(listener);
        dialog.getWindow().findViewById(R.id.share_qq_zone).setOnClickListener(listener);
        dialog.getWindow().findViewById(R.id.share_weibo).setOnClickListener(listener);
        dialog.getWindow().findViewById(R.id.share_weixin).setOnClickListener(listener);
        dialog.getWindow().findViewById(R.id.share_weixin_friends).setOnClickListener(listener);
        dialog.getWindow().findViewById(R.id.share_url).setOnClickListener(listener);
        dialog.setCanceledOnTouchOutside(true);
        return dialog;
    }
}
